<html>
  <head>
    <script type="application/javascript">
      function draw() {
        const ctx = document.getElementById("canvas").getContext("2d");
        ctx.font = "48px serif";
        ctx.fillText("Hello world", 10, 50);
        ctx.strokeText("Hello world", 10, 150);
      }
    </script>
    <style type="text/css">
        canvas {
            border: 1px solid black;
        }
    </style>
  </head>
  <body onload="draw();">
    <canvas id="canvas" width="300" height="200"></canvas>
  </body>
</html>